import { defineStore } from 'pinia'
import { DepartmentList } from '../utils/trueType'
export const useDepartmentStore = defineStore('department', {
    state: () => ({
        departmentTable:[
            {
                id: 1,
                deptName: '部门1',
                status: 1,
                parentId: '',
                createTime: '',
                realName: '',
                children:[]
            }
        ] as DepartmentList[],
        loading: false,
    }),
    actions: {
        changeLoading(){
            this.loading = !this.loading
            setTimeout(() => {
                this.loading = !this.loading
            }, 500);
        },
        setDepartmentTable(data: DepartmentList[]) {
            this.departmentTable = data
        },
    },
    getters: {
        
    },
}
)